package com.ecut;

/*
this关键字
 */
public class User {
    private int id;
    private String name;
    private int age;
    private int money;

    public User() {
        double pi = Math.PI;
        //必须放在构造方法的第一行
//        this(12);
        System.out.println("无参构造方法");
    }

    public User(int money) {
        this();
        this.money = money;
        System.out.println("有参构造方法");
    }

    public void setMoney(int money) {
        this.money += money;

    }


    public static void main(String[] args) {
        //this.money
        //不能在静态方法中使用
        User user = new User();
    }
}
